package com.cus.tom.transfer.kt

import androidx.appcompat.app.AppCompatDelegate
import com.cus.tom.transfer.BuildConfig
import com.cus.tom.transfer.ac.SplashAct
import com.snap.base.base.BaseApp
import com.snap.common.config.AdConfig
import com.snap.common.config.AppConfig
import com.snap.common.plugin.AppPlugin

open class MyApp : BaseApp() {

    override fun onCreate() {
        super.onCreate()
        AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO)
    }

    override fun onAfterAgree() {
        super.onAfterAgree()
    }

    override fun getSplash(): Class<*> {
        return SplashAct::class.java
    }

    override fun getHttpBaseUrl(): String {
        return AppConstant.APP_BASE_URL
    }

    override fun addPlugin(plugins: MutableList<AppPlugin>) {
        super.addPlugin(plugins)
    }

    override fun setAppConfig() {
        AppConfig.apply {
            privacy = BuildConfig.app_privacy
            agreement = BuildConfig.app_agreement
            channel = BuildConfig.CHANNEL
            appKey = AppConstant.APP_KEY
            umID = AppConstant.ID_UMENG
            supportBuy = false

            ad = AdConfig(
                appId = AppConstant.AD_APP_ID,
                appKey = AppConstant.AD_APP_KEY,
                splash = AppConstant.AD_SPLASH,
                insert = AppConstant.AD_INSERT,
                banner = AppConstant.AD_BANNER,
                reward = AppConstant.AD_REWARD,
                native = AppConstant.AD_NATIVE,

                checkLocal = !BuildConfig.DEBUG,
                close = false
            )
        }
    }

}